package com.wowoai.admin.useroption.entity;

import com.wowoai.common.basemodule.BaseEntity;
import com.wowoai.utils.IdGeneratorUtil;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 用户操作记录实体
 */
@Getter
@Setter
@Table(name = "admin_user_option")
@Entity
public class AdminUserOptionEntity extends BaseEntity {

    /**
     * 操作类型
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 操作类型名称
     */
    @Column(name = "type_name")
    private String typeName;

    /**
     * 被操作人ID
     */
    @Column(name = "option_user_id")
    private Long optionUserId;

    /**
     * 被操作人名称
     */
    @Column(name = "option_user_name")
    private String optionUserName;

    /**
     * 永久积分
     */
    @Column(name = "permanent_score_opt")
    private Integer permanentScoreOpt;

    public static AdminUserOptionEntity create(Long id,Long creatorId,String creatorName){
        AdminUserOptionEntity adminUserOptionEntity = new AdminUserOptionEntity();
        adminUserOptionEntity.setId(id);
        adminUserOptionEntity.setCreateTime(System.currentTimeMillis());
        adminUserOptionEntity.setCreatorId(creatorId);
        adminUserOptionEntity.setCreatorName(creatorName);
        adminUserOptionEntity.setDeleted(Boolean.FALSE);
        return adminUserOptionEntity;
    }
}
